import request from '../util/request'

export default  {


  __api__Cart:(customerId)=>{
    return request({
      url:'/cart/'+customerId,
      method:'get'
    })
  },

  __api__CartUpdate:(cartId,skuId,count)=>{
    return request({
      url:'/cart',
      method:'patch',
      data:{cartId:cartId,skuId:skuId,count:count}
    })
  },

  __api__CartItemsDelete:(cartId,itemIds)=>{
    return request({
      url:'/cart/items',
      method:'delete',
      data:{cartId:cartId,cartItemIds:itemIds}
    })
  },

  __api__CartItemsSelectionUpdate:(cartId,itemIds)=>{
    return request({
      url:'/cart/items',
      method:'patch',
      data:{cartId:cartId,cartItemIds:itemIds}
    })
  },

  __api__SkusPage:(params)=>{
    return request({
      url:'/skus',
      method:'get',
      params:params
    })
  },

  __api__SpuDetails:(id)=>{
    return request({
      url:'/spudetails/'+id,
      method:'get'
    })
  },

  __api__OrdersAdd:(order)=>{
    return request({
      url:'/orders',
      method:'post',
      data:order
    })
  },

  __api__Orders:(customerId)=>{
    return request({
      url:'/orders/'+customerId,
      method:'get'
    })
  },

  __api__OrdersStatusUpdate:(code, status)=>{
    return request({
      url:'/orders/status',
      method:'patch',
      data:{code:code,status:status}
    })
  },

  __api__OrdersOne:(id)=>{
    return request({
      url:'/orders/one/'+id,
      method:'get'
    })
  }



}
